package com.tencent.controller;

import com.tencent.Store;
import com.tencent.service.StoreService;
import com.tencent.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/store")
public class StoreController {

    @Autowired
    private StoreService storeService;

    @PostMapping("/add")
    public Result add(@RequestBody Store store){
        try {
            storeService.add(store);
            return new Result();
        } catch (Exception e) {
            return new Result(false, "仓库添加失败");
        }
    }
}
